<template>
  <BaseTable
    :apiUrl="getIpUsedList"
    :rowId="id"
    :isShowAddBtn="false"
    :columns="ipUsedcolumns"
    placeholder="请输入IP地址/云机名称"
    @handleEditOrAdd="$refs.addOrEditRef.open(record)"
  >
    <template #ipAddress="{ record }">
      <ga-link :hoverable="false" @click="$refs.detailInfoRef.open(record)">{{
        record?.ipAddress
      }}</ga-link>
    </template>
    <template #action="{ record }">
      <ga-link>编辑</ga-link>
      <ga-link status="danger">删除</ga-link>
    </template>
  </BaseTable>
  <detailInfo ref="detailInfoRef" />
</template>

<script setup>
import { ipUsedcolumns } from "../../columns";
import { getIpUsedList } from "@/api/layer2subnet";
import detailInfo from "./detailInfo.vue";
import { useRoute } from "vue-router";

const route = useRoute();
const { id } = route.params;
</script>

<style lang="scss" scoped></style>
